Public Class TemplatedControls
    Inherits System.Web.UI.Page

	Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
		MyBase.OnInit(e)
		DotNetNuke.UI.Utilities.ClientAPI.HandleClientAPICallbackEvent(Me)
	End Sub

	Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		'Put user code to initialize the page here
		Dim ary() As String = New String() {"Test Data 1", "Test Data 2", "Test Data 3"}
		Repeater1.DataSource = ary
		Repeater1.DataBind()
	End Sub

    Private Sub MyDNNLabelEdit_UpdateLabel(ByVal source As Object, ByVal e As DotNetNuke.UI.WebControls.DNNLabelEditEventArgs)
        'update database here
        Dim o As DotNetNuke.UI.WebControls.DNNLabelEdit = CType(source, DotNetNuke.UI.WebControls.DNNLabelEdit)
        Dim sId As String = o.ClientID        '
    End Sub

    Protected Sub MyDNNTextSuggest_PopulateOnDemand(ByVal source As Object, ByVal e As DotNetNuke.UI.WebControls.DNNTextSuggestEventArgs)
        Dim o As DotNetNuke.UI.WebControls.DNNTextSuggest = CType(source, DotNetNuke.UI.WebControls.DNNTextSuggest)
        Dim objNode As DotNetNuke.UI.WebControls.DNNNode
        For i As Integer = 1 To 10
            objNode = New DotNetNuke.UI.WebControls.DNNNode("Node-" & i)
            objNode.ID = i
            o.DNNNodes.Add(objNode)
        Next
    End Sub

    Private Sub Repeater1_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles Repeater1.ItemCreated

        Dim o As DotNetNuke.UI.WebControls.DNNLabelEdit = CType(e.Item.Controls(3), DotNetNuke.UI.WebControls.DNNLabelEdit)
        AddHandler o.UpdateLabel, AddressOf MyDNNLabelEdit_UpdateLabel

        Dim oTS As DotNetNuke.UI.WebControls.DNNTextSuggest = CType(e.Item.Controls(5), DotNetNuke.UI.WebControls.DNNTextSuggest)
        AddHandler oTS.PopulateOnDemand, AddressOf MyDNNTextSuggest_PopulateOnDemand
    End Sub

End Class
